NXRunLocalizedAlertPanel(NULL, "Open", "Invalid path: %s", NULL, NULL, NULL, directory, "Alert shown to user when he has tried to open up a file and has specified a file in a directory which is inaccessible. The directory is either unreadable or does not exist for some reason.");
if (directory && (*directory == '/')) [openpanel setDirectory:directory];
if ([openpanel runModalForTypes:drawFileTypes]) {
files = [openpanel filenames];
directory = [openpanel directory];
while (files && *files) {
if (*files) haveOpenedDocument = openFile(directory, *files, YES) || haveOpenedDocument;
files++;
}
}
return self;
}
- saveAll:sender
/*
* Saves all the documents.
*/
{
int count;
Window *window;
count = [windowList count];
while (count--) {
window = [windowList objectAt:count];
[documentInWindow(window) save:sender];
}
return nil;
}
#define UNSAVED_DOCUMENTS NXLocalString("You have unsaved documents.", NULL, "Message given to user when he tries to quit the application without saving all of his documents.")
#define REVIEW_UNSAVED NXLocalString("Review Unsaved", NULL, "Choice (on a button) given to user which allows him to review all his unsaved documents if he quits the application without saving them all first.")
#define QUIT_ANYWAY NXLocalString("Quit Anyway", NULL, "Choice (on a button) given to user which allows him to quit the application even though he has not saved all of his documents first.")
#define QUIT NXLocalString("Quit", NULL, "The operation of exiting the application.")
- terminate:sender cancellable:(BOOL)cancellable
/*
* Makes sure all documents get an opportunity
* to be saved before exiting the program. If we are terminating because
* the user logged out of the workspace (or powered off), then we cannot
* give the user the option of cancelling the quit (that's what the
* cancellable flag is for).
*/
{
int count, choice;
Window *window;
id document;
count = [windowList count];
while (count--) {
window = [windowList objectAt:count];
document = [window delegate];
if ([document respondsTo:@selector(isDirty)] && [document isDirty]) {